#ifndef COMMON_INCLUDE_H
#define COMMON_INCLUDE_H

#include "hdf_device_desc.h"
#include "osal_mem.h"
#include "hdf_log.h"
#include "hdf_types.h"

#define CHECK_RETURN_VALUE(ret, keyword) do { \
    if ((ret) != HDF_SUCCESS) { \
        HDF_LOGE("%s: line = %d, %s", __func__, __LINE__, (keyword)); \
        return ret; \
    } \
} while (0)

#define CHECK_POINTER_RETURN_VALUE(pointer, ret, keyword) do { \
    if ((pointer) == NULL) { \
        HDF_LOGE("%s: line = %d, %s", __func__, __LINE__, (keyword)); \
        return ret; \
    } \
} while (0)

#define CHECK_POINTER(pointer, keyword) do { \
    if ((pointer) == NULL) { \
        HDF_LOGE("%s: line = %d, %s", __func__, __LINE__, (keyword)); \
        return NULL; \
    } \
} while (0)

#endif